// 导入api对象
import api from './api';

// 组件相关的API调用
const componentService = {
  // 获取所有组件
  getAllComponents: () => api.get('/components'),
  // 根据ID获取组件
  getComponentById: (id) => api.get(`/components/${id}`),
  // 创建组件
  createComponent: (componentData) => api.post('/components', componentData),
  // 更新组件
  updateComponent: (id, componentData) => api.put(`/components/${id}`, componentData),
  // 删除组件
  deleteComponent: (id) => api.delete(`/components/${id}`)
};

export default componentService;